.global _start

_start:
    ldr r0, =0x020c4068      /* register CCGR0*/
    ldr r1, =0xffffffff
    str r1, [r0]

    ldr r0, =0x020c406c      /* register CCGR1 */
    ldr r1, =0xffffffff
    str r1, [r0]

    ldr r0, =0x020c4070     /* register CCGR2 */
    ldr r1, =0xffffffff
    str r1, [r0]

    ldr r0, =0x020c4074     /* register CCGR3 */
    ldr r1, =0xffffffff
    str r1, [r0]

    ldr r0, =0x020c4078     /* register CCGR4 */
    ldr r1, =0xffffffff 
    str r1, [r0]

    ldr r0, =0x020c407c     /* register CCGR5 */
    ldr r1, =0xffffffff
    str r1, [r0]

    ldr r0, =0x020c4080     /* register CCGR6 */
    ldr r1, =0xffffffff
    str r1, [r0]

    /* =======LED-USER======== */
    /* set IO mux */
    ldr r0, =0x02290014     /* set SNVS_TAMPER3 to GPIO5_IO03 */
    ldr r1, =0x05
    str r1, [r0]

    ldr r0, =0x02290058     /* set SNVS_TAMPER3 PAD */
    ldr r1, =0x10b0         
    str r1, [r0]

    /* set GPIO5_IO03 electric attr */
    ldr r0, =0x020ac004     /* GPIO5_GDIR */
    ldr r1, =0x08           /* set GPIO5_IO03 output mode */
    str r1, [r0]

    ldr r0, =0x020ac000     /* GPIO5_DR */
    ldr r1, =0x0            /* enable led */
    str r1, [r0]

    /* =======LED-GREEN======== */
    /* set IO mux */
    ldr r0, =0x020e01e0     /* set CSI_HYSYNC to GPIO4_IO20 */
    ldr r1, =0x05
    str r1, [r0]

    ldr r0, =0x020e046c     /* set CSI_HYSYNC PAD */
    ldr r1, =0x10b0         
    str r1, [r0]

    /* set GPIO4_IO20 electric attr */
    ldr r0, =0x020a8004    /* GPIO4_GDIR */
    ldr r1, =0x00100000    /* set GPIO4_IO20 output mode */
    str r1, [r0]

    ldr r0, =0x020a8000     /* GPIO5_DR */
    ldr r1, =0x0            /* enable led */
    str r1, [r0]

loop:
    b loop

